<template>
	<uni-list>
		<!-- title、note设置标题和小文字 -->
		<uni-list-item clickable class="uni-list-item" direction="row" v-for="item in listData" :key="item.id"
			:title="item.name" @tap="gotolist(item.id)">

		</uni-list-item>
		<page-tabpars></page-tabpars>
	</uni-list>
</template>

<script>
	// 引用
	import mockData from './mock.json';
	export default {
		data() {
			return {
				listData: []
			}
		},
		onLoad() {

		},
		created() {


			// uni.request({
			// 	url: "http://localhost:8092/book/listBookCategory",
			// 	method: 'get',
			// 	dataType: 'json',
			// 	success: (res) => {
			// 		console.log(res.data);
			// 		this.listData = res.data.rows;
			// 	},
			// });
			this.$myRequist({
				url: "/book/listBookCategory"
			}).then(res => {
				this.listData = res.data.rows;
			})
		},
		methods: {
			gotolist(id) {
let addr = "/book/listRank/new?catId="+id;
				uni.navigateTo({
					url: '/pages/book/booklist/booklist?add=' + addr
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	/* 	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	} */

	.image-1item {
		flex-shrink: 0;
		margin-right: 10px;
		width: 50px;
		height: 75px;
		border-radius: 6px;
		overflow: hidden;
		border: 1px #f5f5f5 solid;
	}
</style>
